package n.d.l.svn.web;

import java.util.List;

import n.d.l.svn.bean.PatchLog;
import n.d.l.svn.service.PatchLogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller()
@RequestMapping("log")
public class PatchLogController {

	@Autowired
	private PatchLogService patchLogService;
	
	@RequestMapping(value="td", method=RequestMethod.GET)
	public String toLogPage(PatchLog log, Model model){
		model.addAttribute("plog", log);
		return "patchLog";
	}
	
	@RequestMapping(value="logs", method=RequestMethod.GET)
	@ResponseBody
	public List<PatchLog> findList(PatchLog log){
		return patchLogService.findList(log);
	}
	
	@RequestMapping(value="ld", method=RequestMethod.GET)
	public String logDetail(PatchLog log, Model model){
		model.addAttribute("plog", patchLogService.logDetail(log));
		return "logDetail";
	}
}
